package net.bwie.realtime.dws.log.function;

import net.bwie.realtime.dws.log.bean.AreaControl;
import org.apache.flink.api.common.functions.ReduceFunction;

public class PageViewReportReduceFunction implements ReduceFunction<AreaControl> {
    @Override
    public AreaControl reduce(AreaControl value1, AreaControl value2) throws Exception {
        // value1：表示增加计算中间结果；value2：表示窗口中每条数据
        // 1.增量计算：表示各个指标相加
        value1.setCarCount(value1.getCarCount() + value2.getCarCount());
        // 2.返回结果
        return value1;
    }
}
